package org.kardigen.lg.admin.client.training.event;

import org.kardigen.lg.service.client.proxy.TrainingProxy;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class TrainingSelectionEvent extends GwtEvent<TrainingSelectionEvent.Handler> {

	public interface Handler extends EventHandler {
		void onEvent(TrainingSelectionEvent trainingEvent);
	}

	public static Type<TrainingSelectionEvent.Handler> TYPE = new Type<TrainingSelectionEvent.Handler>();

	private final TrainingProxy proxy;


	public TrainingSelectionEvent(TrainingProxy proxy) {
		this.proxy = proxy;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onEvent(this);
	}

	public TrainingProxy getProxy() {
		return proxy;
	}

}
